<!-- toaster directive -->
<toaster-container toaster-options="{'position-class': 'toast-top-right', 'close-button':true}"></toaster-container>
<!-- / toaster directive -->

<!-- 导航条 -->
<div class="bg-white bread-crumb">
    <ul class="breadcrumb b-a m-b-n-xs lter b-b wrapper-md">
        <li><a ui-sref="main.tpl.homePage"><i class="fa fa-home"></i> 首页</a></li>
        <li class="active" ng-bind="title"></li>
    </ul>
</div>

<!-- 加载提醒 -->
<div ng-show="loading" class="text-center m-t-md text-lg"><i class="fa fa-spin fa-spinner"></i> 数据加载中...</div>

<!-- 内容区域 -->
<div ng-hide="loading" class="wrapper-md content">
    <!-- 数据显示 -->
    <div class="wrapper-data">
        <div class="panel panel-default">
            <!-- 头部 -->
            <div class="panel-body">
                <!-- 头部 -->
                <form ng-submit="searchRe()" class="form-horizontal">
                    <div class="form-group">

                        <div class="col-sm-2">
                            <input type="text" class="form-control" placeholder="用户ID" ng-model="param.userId">
                        </div>

                        <div class="col-sm-2">
                            <input type="text" class="form-control" placeholder="企业名称" ng-model="param.companyName">
                        </div>

                        <div class="col-sm-2">
                            <input type="text" id="applyStartdate" ng-model="param.applyStartdate"  placeholder="申请开始时间" class="form-control" onclick="laydate({istime: true, format: 'YYYY-MM-DD', start: laydate.now(0, 'YYYY-MM-DD')})"/>
                        </div>
                        <div class="col-sm-2">
                            <input type="text" id="applyEnddate" ng-model="param.applyEnddate" placeholder="申请结束时间" class="form-control" onclick="laydate({istime: true, format: 'YYYY-MM-DD', start: laydate.now(0, 'YYYY-MM-DD')})"/>
                        </div>

                        <div class="col-sm-2">
                            <input type="text" id="examineStartdate" ng-model="param.examineStartdate" placeholder="审核开始时间" class="form-control" onclick="laydate({istime: true, format: 'YYYY-MM-DD', start: laydate.now(0, 'YYYY-MM-DD')})"/>
                        </div>
                        <div class="col-sm-2">
                            <input type="text" id="examineEnddate" ng-model="param.examineEnddate" placeholder="审核结束时间" class="form-control" onclick="laydate({istime: true, format: 'YYYY-MM-DD', start: laydate.now(0, 'YYYY-MM-DD')})"/>
                        </div>
                    </div>

                    <div class="form-group">
                        <div class="col-sm-2">
                            <select class="form-control" ng-model="param.tradeType">
                                <option value="">全部交易类型</option>
                                <option value="1">充值</option>
                                <option value="2">提现</option>
                                <option value="3">收入</option>
                                <option value="4">抵扣</option>
                                <option value="5">0元投返现</option>
                                <option value="6">冲销</option>
                            </select>
                        </div>

                        <div class="col-sm-2">
                            <select class="form-control" ng-model="param.userType">
                                <option value="">全部账户类型</option>
                                <option value="1">广告主</option>
                                <option value="2">流量主</option>
                            </select>
                        </div>

                        <div class="col-sm-2">
                            <input type="text" class="form-control" placeholder="流水号" ng-model="param.flowId">
                        </div>

                        <div class="col-sm-2">
                            <input type="text" ng-model="param.tradeAmountMin" id=""  placeholder="最小交易金额" class="form-control" />
                        </div>
                        <div class="col-sm-2">
                            <input type="text" ng-model="param.tradeAmountMax" placeholder="最大交易金额" class="form-control"/>
                        </div>
                        <div class="col-sm-2">
                            <select class="form-control" ng-model="param.tradeChannel">
                                <option value="">全部交易方式</option>
                                <option value="1">支付宝</option>
                                <option value="2">财付通</option>
                                <option value="3">银行转账</option>
                                <option value="4">现金</option>
                                <option value="5">0元投返现</option>
                                <option value="6">冲销</option>
                            </select>
                        </div>
                    </div>

                    <div class="form-group">
                        <div class="col-sm-2">
                            <select class="form-control" ng-model="param.status">
                                <option value="">全部交易状态</option>
                                <option value="0">处理中</option>
                                <option value="1">交易完成</option>
                                <option value="2">交易失败</option>
                            </select>
                        </div>
                        <div class="col-sm-2">
                            <input type="text" class="form-control" placeholder="外部流水号" ng-model="param.outTradeNo">
                        </div>

                        <div class="col-md-1">
                            <label class="col-sm-1 control-label"><button class="ifc-btn btn-primary"  ng-click="searchRe()">查 询</button></label>
                        </div>
                        <div class="col-md-1">
                            <label class="col-sm-1 control-label"><button type="button" class="ifc-btn btn-dark" ng-click="clearSearch()">清 空</button></label>
                        </div>
                    </div>
                </form>
            </div>
            <!-- 数据表格 -->
            <div class="table-responsive">
                <table class="table table-striped b-t b-light text-center">
                    <thead>
                    <tr>
                        <th>全选</th>
                        <th>流水号</th>
                        <th>交易类型</th>
                        <th>交易方式</th>
                        <th>用户ID</th>
                        <th>账号/卡号</th>
                        <th>企业名称</th>
                        <th>账户类型</th>
                        <th>交易金额</th>
                        <th>交易时间</th>
                        <th>状态</th>
                    </tr>
                    </thead>
                    <tbody>
                    <tr ng-repeat="item in pageInfo.records">
                        <td><input class="v-middle" ng-model="subCheckBox" type="checkbox"/>{{item.id}}</td>
                        <td class="v-middle">{{item.flowId}}</td>

                        <td class="v-middle">
                            <span ng-if="item.tradeType=='1'">充值</span>
                            <span ng-if="item.tradeType=='2'">提现</span>
                            <span ng-if="item.tradeType=='3'">收入</span>
                            <span ng-if="item.tradeType=='4'">抵扣</span>
                            <span ng-if="item.tradeType=='5'">0元投返现</span>
                            <span ng-if="item.tradeType=='6'">冲销</span>
                        </td>
                        <td class="v-middle">
                            <span ng-if="item.tradeChannel=='1'">支付宝</span>
                            <span ng-if="item.tradeChannel=='2'">财付通</span>
                            <span ng-if="item.tradeChannel=='3'">银行转账</span>
                            <span ng-if="item.tradeChannel=='4'">现金</span>
                            <span ng-if="item.tradeChannel=='5'">0元投返现</span>
                            <span ng-if="item.tradeChannel=='6'">冲销</span>
                            </td>
                        <td class="v-middle">
                            {{item.userId}}
                        </td>
                        <td class="v-middle">
                            {{item.bankName}}<br/>
                            {{item.bankCardNo}}
                        </td>
                        <td class="v-middle">{{item.companyName}}</td>

                        <td class="v-middle">
                            <span ng-if="item.creditAcctType=='1'">广告主</span>
                            <span ng-if="item.creditAcctType=='2'">流量主</span>
                        </td>
                        <td class="v-middle">
                            {{item.tradeAmountFact}}
                        </td>
                        <td class="v-middle">
                            <!--<span ng-if="item.state=='V'">正常</span>-->
                            <!--<span ng-if="item.state=='S'" class="text-danger">休眠</span>-->
                            <!--<span ng-if="item.state=='C'" class="text-success">注销</span>-->
                            {{item.tradeTime | date:'yyyy-MM-dd HH:mm:ss'}}
                        </td>
                        <td class="v-middle">
                            <span ng-if="item.status=='0'" class="text-primary-dker">处理中</span>
                            <span ng-if="item.status=='1'" class="text-success">交易完成</span>
                            <span ng-if="item.status=='2'" class="text-danger">交易失败</span>
                        </td>
                    </tr>
                    </tbody>
                </table>
            </div><!-- /.table-responsive -->

            <!-- 底部分页 -->
            <span data-ng-include=" 'src/tpl/pageInfo.html' "></span>
        </div><!-- /.panel -->
    </div><!-- /.wrapper-data -->

</div><!-- /.wrapper-md -->